package top.continew.admin.req;

import cn.shengchao.examstar.rpc.uddsys.req.DistributeNodeInfoEditReq;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import top.continew.admin.system.util.ValidateGroup;

import java.io.Serializable;

/**
 * @program: examstar-manger-api
 * @description: 创建分销链用户的接口
 * @author: Xiong weiqiang
 * @create: 2025-03-27 11:39
 */
@Data
public class DistributeNodeInfoEditRto implements Serializable {
    private Integer distributeType;
    @NotNull(message = "用户不能为空",groups = {ValidateGroup.ReqGroup.SAVE.class, ValidateGroup.ReqGroup.UPDATE.class})
    private Long userId;
    @NotBlank(message = "简称不能为空",groups = {ValidateGroup.ReqGroup.SAVE.class, ValidateGroup.ReqGroup.UPDATE.class})
    private String shortName;
    @NotBlank(message = "全称不能为空",groups = {ValidateGroup.ReqGroup.SAVE.class, ValidateGroup.ReqGroup.UPDATE.class})
    private String fullName;
    private String headImgUrl;
    private String pInLaw;
    private String licNo;
    private String contactPhone;
    private String contactMan;


    public static DistributeNodeInfoEditReq buildToReq(DistributeNodeInfoEditRto rto){
        DistributeNodeInfoEditReq req = new DistributeNodeInfoEditReq();
        req.setDistributeType(rto.getDistributeType());
        req.setUserId(rto.getUserId());
        req.setShortName(rto.getShortName());
        req.setFullName(rto.getFullName());
        req.setHeadImgUrl(rto.getHeadImgUrl());
        req.setPInLaw(rto.getPInLaw());
        req.setLicNo(rto.getLicNo());
        req.setContactPhone(rto.getContactPhone());
        return req;
    }
}